home *** CD-ROM | disk | FTP | other *** search
/ William Shakespeare - The Complete Works / William Shakespeare - The Complete Works on CD-ROM.iso / classic / cursor.frm < prev    next >
Text File  |  1993-10-25  |  14KB  |  463 lines

  1. VERSION 2.00
  2. Begin Form CursorDemo 
  3.    Caption         =   "VB Custom Cursor Demo"
  4.    Height          =   5475
  5.    Icon            =   CURSOR.FRX:0000
  6.    Left            =   1710
  7.    LinkTopic       =   "Form3"
  8.    ScaleHeight     =   5070
  9.    ScaleWidth      =   7035
  10.    Top             =   1230
  11.    Width           =   7155
  12.    Begin PictureBox picCursorMask6 
  13.       Height          =   510
  14.       Left            =   3060
  15.       Picture         =   CURSOR.FRX:0302
  16.       ScaleHeight     =   32
  17.       ScaleMode       =   3  'Pixel
  18.       ScaleWidth      =   32
  19.       TabIndex        =   36
  20.       Top             =   4140
  21.       Width           =   510
  22.    End
  23.    Begin PictureBox picCursor6 
  24.       AutoRedraw      =   -1  'True
  25.       Height          =   510
  26.       Left            =   3060
  27.       Picture         =   CURSOR.FRX:0604
  28.       ScaleHeight     =   32
  29.       ScaleMode       =   3  'Pixel
  30.       ScaleWidth      =   32
  31.       TabIndex        =   34
  32.       Top             =   3360
  33.       Width           =   510
  34.    End
  35.    Begin PictureBox picCursorMask5 
  36.       Height          =   510
  37.       Left            =   2580
  38.       Picture         =   CURSOR.FRX:0906
  39.       ScaleHeight     =   32
  40.       ScaleMode       =   3  'Pixel
  41.       ScaleWidth      =   32
  42.       TabIndex        =   33
  43.       Top             =   4140
  44.       Width           =   510
  45.    End
  46.    Begin PictureBox picCursor5 
  47.       AutoRedraw      =   -1  'True
  48.       Height          =   510
  49.       Left            =   2580
  50.       Picture         =   CURSOR.FRX:0C08
  51.       ScaleHeight     =   32
  52.       ScaleMode       =   3  'Pixel
  53.       ScaleWidth      =   32
  54.       TabIndex        =   31
  55.       Top             =   3360
  56.       Width           =   510
  57.    End
  58.    Begin PictureBox picCursorMask0 
  59.       Height          =   510
  60.       Left            =   180
  61.       Picture         =   CURSOR.FRX:0F0A
  62.       ScaleHeight     =   32
  63.       ScaleMode       =   3  'Pixel
  64.       ScaleWidth      =   32
  65.       TabIndex        =   29
  66.       Top             =   4140
  67.       Width           =   510
  68.    End
  69.    Begin PictureBox picCursor0 
  70.       AutoRedraw      =   -1  'True
  71.       Height          =   510
  72.       Left            =   180
  73.       Picture         =   CURSOR.FRX:120C
  74.       ScaleHeight     =   32
  75.       ScaleMode       =   3  'Pixel
  76.       ScaleWidth      =   32
  77.       TabIndex        =   28
  78.       Top             =   3360
  79.       Width           =   510
  80.    End
  81.    Begin OptionButton Option1 
  82.       Caption         =   "Option1"
  83.       Height          =   315
  84.       Left            =   4080
  85.       TabIndex        =   18
  86.       Top             =   3300
  87.       Value           =   -1  'True
  88.       Width           =   1035
  89.    End
  90.    Begin OptionButton Option2 
  91.       Caption         =   "Option2"
  92.       Height          =   315
  93.       Left            =   4080
  94.       TabIndex        =   17
  95.       Top             =   3600
  96.       Width           =   1035
  97.    End
  98.    Begin VScrollBar VScroll2 
  99.       Height          =   1335
  100.       Left            =   1380
  101.       TabIndex        =   16
  102.       Top             =   1260
  103.       Width           =   255
  104.    End
  105.    Begin VScrollBar VScroll1 
  106.       Height          =   1335
  107.       Left            =   480
  108.       TabIndex        =   15
  109.       Top             =   1260
  110.       Width           =   255
  111.    End
  112.    Begin CommandButton Command1 
  113.       Caption         =   "Command1"
  114.       Height          =   495
  115.       Left            =   5640
  116.       TabIndex        =   14
  117.       Top             =   3480
  118.       Width           =   1215
  119.    End
  120.    Begin PictureBox picCursorMask4 
  121.       Height          =   510
  122.       Left            =   2100
  123.       Picture         =   CURSOR.FRX:150E
  124.       ScaleHeight     =   32
  125.       ScaleMode       =   3  'Pixel
  126.       ScaleWidth      =   32
  127.       TabIndex        =   13
  128.       Top             =   4140
  129.       Width           =   510
  130.    End
  131.    Begin PictureBox picCursorMask3 
  132.       Height          =   510
  133.       Left            =   1620
  134.       Picture         =   CURSOR.FRX:1810
  135.       ScaleHeight     =   32
  136.       ScaleMode       =   3  'Pixel
  137.       ScaleWidth      =   32
  138.       TabIndex        =   12
  139.       Top             =   4140
  140.       Width           =   510
  141.    End
  142.    Begin PictureBox picCursor4 
  143.       AutoRedraw      =   -1  'True
  144.       Height          =   510
  145.       Left            =   2100
  146.       Picture         =   CURSOR.FRX:1B12
  147.       ScaleHeight     =   32
  148.       ScaleMode       =   3  'Pixel
  149.       ScaleWidth      =   32
  150.       TabIndex        =   11
  151.       Top             =   3360
  152.       Width           =   510
  153.    End
  154.    Begin PictureBox picCursor3 
  155.       AutoRedraw      =   -1  'True
  156.       Height          =   510
  157.       Left            =   1620
  158.       Picture         =   CURSOR.FRX:1E14
  159.       ScaleHeight     =   32
  160.       ScaleMode       =   3  'Pixel
  161.       ScaleWidth      =   32
  162.       TabIndex        =   10
  163.       Top             =   3360
  164.       Width           =   510
  165.    End
  166.    Begin PictureBox picCursorMask2 
  167.       Height          =   510
  168.       Left            =   1140
  169.       Picture         =   CURSOR.FRX:2116
  170.       ScaleHeight     =   32
  171.       ScaleMode       =   3  'Pixel
  172.       ScaleWidth      =   32
  173.       TabIndex        =   7
  174.       Top             =   4140
  175.       Width           =   510
  176.    End
  177.    Begin PictureBox picCursor2 
  178.       AutoRedraw      =   -1  'True
  179.       Height          =   510
  180.       Left            =   1140
  181.       Picture         =   CURSOR.FRX:2418
  182.       ScaleHeight     =   32
  183.       ScaleMode       =   3  'Pixel
  184.       ScaleWidth      =   32
  185.       TabIndex        =   6
  186.       Top             =   3360
  187.       Width           =   510
  188.    End
  189.    Begin TextBox Text2 
  190.       Height          =   1335
  191.       Left            =   3900
  192.       MultiLine       =   -1  'True
  193.       TabIndex        =   5
  194.       Text            =   "x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x"
  195.       Top             =   1320
  196.       Width           =   1275
  197.    End
  198.    Begin PictureBox picCursorMask1 
  199.       Height          =   510
  200.       Left            =   660
  201.       Picture         =   CURSOR.FRX:271A
  202.       ScaleHeight     =   32
  203.       ScaleMode       =   3  'Pixel
  204.       ScaleWidth      =   32
  205.       TabIndex        =   4
  206.       Top             =   4140
  207.       Width           =   510
  208.    End
  209.    Begin PictureBox picCursor1 
  210.       AutoRedraw      =   -1  'True
  211.       Height          =   510
  212.       Left            =   660
  213.       Picture         =   CURSOR.FRX:2A1C
  214.       ScaleHeight     =   32
  215.       ScaleMode       =   3  'Pixel
  216.       ScaleWidth      =   32
  217.       TabIndex        =   3
  218.       Top             =   3360
  219.       Width           =   510
  220.    End
  221.    Begin CommandButton cmdExit 
  222.       Caption         =   "E&xit"
  223.       Height          =   495
  224.       Left            =   5640
  225.       TabIndex        =   2
  226.       Top             =   4080
  227.       Width           =   1215
  228.    End
  229.    Begin TextBox Text1 
  230.       Height          =   1335
  231.       Left            =   2400
  232.       MousePointer    =   3  'I-Beam
  233.       MultiLine       =   -1  'True
  234.       TabIndex        =   0
  235.       Text            =   "x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x"
  236.       Top             =   1320
  237.       Width           =   1275
  238.    End
  239.    Begin Label Label10 
  240.       Caption         =   "Image1"
  241.       Height          =   195
  242.       Left            =   5820
  243.       TabIndex        =   38
  244.       Top             =   2220
  245.       Width           =   630
  246.    End
  247.    Begin Image Image1 
  248.       Height          =   480
  249.       Left            =   5880
  250.       Picture         =   CURSOR.FRX:2D1E
  251.       Top             =   2520
  252.       Width           =   480
  253.    End
  254.    Begin Label Label1 
  255.       BorderStyle     =   1  'Fixed Single
  256.       Caption         =   "Label1"
  257.       Height          =   495
  258.       Left            =   5580
  259.       TabIndex        =   37
  260.       Top             =   1320
  261.       Width           =   1215
  262.    End
  263.    Begin Label Label9 
  264.       Alignment       =   2  'Center
  265.       Caption         =   "6"
  266.       Height          =   195
  267.       Index           =   6
  268.       Left            =   3180
  269.       TabIndex        =   35
  270.       Top             =   3900
  271.       Width           =   240
  272.    End
  273.    Begin Label Label9 
  274.       Alignment       =   2  'Center
  275.       Caption         =   "5"
  276.       Height          =   195
  277.       Index           =   5
  278.       Left            =   2700
  279.       TabIndex        =   32
  280.       Top             =   3900
  281.       Width           =   240
  282.    End
  283.    Begin Label Label9 
  284.       Alignment       =   2  'Center
  285.       Caption         =   "4"
  286.       Height          =   195
  287.       Index           =   4
  288.       Left            =   2220
  289.       TabIndex        =   30
  290.       Top             =   3900
  291.       Width           =   240
  292.    End
  293.    Begin Label Label9 
  294.       Alignment       =   2  'Center
  295.       Caption         =   "3"
  296.       Height          =   195
  297.       Index           =   3
  298.       Left            =   1740
  299.       TabIndex        =   27
  300.       Top             =   3900
  301.       Width           =   240
  302.    End
  303.    Begin Label Label9 
  304.       Alignment       =   2  'Center
  305.       Caption         =   "2"
  306.       Height          =   195
  307.       Index           =   2
  308.       Left            =   1260
  309.       TabIndex        =   26
  310.       Top             =   3900
  311.       Width           =   240
  312.    End
  313.    Begin Label Label9 
  314.       Alignment       =   2  'Center
  315.       Caption         =   "1"
  316.       Height          =   195
  317.       Index           =   1
  318.       Left            =   780
  319.       TabIndex        =   25
  320.       Top             =   3900
  321.       Width           =   240
  322.    End
  323.    Begin Label Label9 
  324.       Alignment       =   2  'Center
  325.       Caption         =   "0"
  326.       Height          =   195
  327.       Index           =   0
  328.       Left            =   300
  329.       TabIndex        =   24
  330.       Top             =   3900
  331.       Width           =   240
  332.    End
  333.    Begin Label Label8 
  334.       Caption         =   "cmdExit"
  335.       Height          =   195
  336.       Left            =   5940
  337.       TabIndex        =   23
  338.       Top             =   4620
  339.       Width           =   675
  340.    End
  341.    Begin Label Label7 
  342.       Caption         =   "Text2"
  343.       Height          =   195
  344.       Left            =   4260
  345.       TabIndex        =   22
  346.       Top             =   1020
  347.       Width           =   495
  348.    End
  349.    Begin Label Label6 
  350.       Caption         =   "Text1"
  351.       Height          =   195
  352.       Left            =   2760
  353.       TabIndex        =   21
  354.       Top             =   1020
  355.       Width           =   495
  356.    End
  357.    Begin Label Label4 
  358.       Caption         =   "VScroll2"
  359.       Height          =   195
  360.       Left            =   1140
  361.       TabIndex        =   20
  362.       Top             =   960
  363.       Width           =   720
  364.    End
  365.    Begin Label Label11 
  366.       Caption         =   "VScroll1"
  367.       Height          =   195
  368.       Left            =   240
  369.       TabIndex        =   19
  370.       Top             =   960
  371.       Width           =   720
  372.    End
  373.    Begin Label Label5 
  374.       Caption         =   "picCursorMask"
  375.       Height          =   195
  376.       Left            =   1320
  377.       TabIndex        =   9
  378.       Top             =   4680
  379.       Width           =   1260
  380.    End
  381.    Begin Label Label2 
  382.       AutoSize        =   -1  'True
  383.       Caption         =   "picCursor"
  384.       Height          =   195
  385.       Left            =   1500
  386.       TabIndex        =   8
  387.       Top             =   3120
  388.       Width           =   810
  389.    End
  390.    Begin Line Line1 
  391.       BorderWidth     =   2
  392.       X1              =   660
  393.       X2              =   6600
  394.       Y1              =   660
  395.       Y2              =   660
  396.    End
  397.    Begin Label Label3 
  398.       Caption         =   "Move the mouse pointer over the form and controls to see the cursor changes.  Use the mouse on the controls to test the hot spots."
  399.       ForeColor       =   &H00FF0000&
  400.       Height          =   435
  401.       Left            =   720
  402.       TabIndex        =   1
  403.       Top             =   120
  404.       Width           =   6015
  405.       WordWrap        =   -1  'True
  406.    End
  407. End
  408. Dim ciForm      As CursorInfo
  409. Dim ciVScroll   As CursorInfo
  410. Dim ciText      As CursorInfo
  411. Dim ciOption    As CursorInfo
  412. Dim ciCommand   As CursorInfo
  413. Dim ciLabel     As CursorInfo
  414. Dim ciImage     As CursorInfo
  415.  
  416. Sub CheckFormCursor (hCursor As Integer)
  417. Static hFormCursor As Integer
  418.     If hFormCursor <> hCursor Then
  419.        z% = ChangeCursor(ciForm.hWnd, hCursor)
  420.        hFormCursor = hCursor
  421.     End If
  422. End Sub
  423.  
  424. Sub cmdExit_Click ()
  425.     Unload CursorDemo
  426. End Sub
  427.  
  428. Sub Form_Load ()
  429.     MakeCursor CursorDemo.hWnd, picCursor0, picCursorMask0, ciForm
  430.     MakeCursor Command1.hWnd, picCursor1, picCursorMask1, ciCommand
  431.     MakeCursor Text1.hWnd, picCursor2, picCursorMask2, ciText
  432.     MakeCursor Option1.hWnd, picCursor3, picCursorMask3, ciOption
  433.     MakeCursor VScroll1.hWnd, picCursor4, picCursorMask4, ciVScroll
  434.     MakeCursor CursorDemo.hWnd, picCursor5, picCursorMask5, ciImage
  435.     MakeCursor CursorDemo.hWnd, picCursor6, picCursorMask6, ciLabel
  436.     
  437.     CheckFormCursor ciForm.hNewCursor
  438. End Sub
  439.  
  440. Sub Form_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  441.     CheckFormCursor ciForm.hNewCursor
  442. End Sub
  443.  
  444. Sub Form_Unload (Cancel As Integer)
  445.     RestoreCursor ciVScroll
  446.     RestoreCursor ciText
  447.     RestoreCursor ciOption
  448.     RestoreCursor ciCommand
  449.     RestoreCursor ciLabel
  450.     RestoreCursor ciImage
  451.     RestoreCursor ciForm
  452.     End
  453. End Sub
  454.  
  455. Sub Image1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  456.     CheckFormCursor ciImage.hNewCursor
  457. End Sub
  458.  
  459. Sub Label1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  460.     CheckFormCursor ciLabel.hNewCursor
  461. End Sub
  462.  
  463.